package com.homework.dao.impl;

import com.homework.dao.UserDAO;
import com.homework.entity.User;
import com.homework.util.JDBCUtils;

import java.util.List;

/**
 * @author: XiangHu
 * @date: 2025年03月02日 23:51
 * @describe:
 */
public class UserDAOImpl implements UserDAO {
    @Override
    public User selectUserByUsername(String username) {
        List<User> users = JDBCUtils.query(User.class, "select*from t_user where username=?", username);
        if (users.size() > 0) {
            return users.get(0);
        }
        return null;
    }
}